package types

type CreateOrganizeDepartmentReqForApi struct {
	ParentId       uint64 `msg:"父级部门ID" json:"parentId" validate:"omitempty"`                         // 新增字段
	DepartmentName string `msg:"部门名称" json:"departmentName" validate:"required"`                      // 部门名称: 必填
	Remark         string `msg:"备注" json:"remark" validate:"omitempty"`                               // 备注: 可选
	OrganId        uint64 `json:"organId,optional" form:"organId,optional" validate:"omitempty,gt=0"` //组织机构ID
}

type UpdateOrganizeDepartmentReqForApi struct {
	Id             uint64 `msg:"部门ID" json:"id" validate:"required"`              // 部门ID: 必填，必须大于0
	DepartmentName string `msg:"部门名称" json:"departmentName" validate:"omitempty"` // 部门名称: 可选
	Remark         string `msg:"备注" json:"remark" validate:"omitempty"`           // 备注: 可选
}

type GetOrganizeDepartmentByIdReqForApi struct {
	Id uint64 `form:"id" validate:"required"` // 部门ID: 必填，必须大于0
}

type GetOrganizeDepartmentByIdRespForApi struct {
	Id             uint64 `json:"id"`                                             // 部门ID
	DepartmentName string `msg:"部门名称" json:"departmentName" validate:"omitempty"` // 部门名称
	Remark         string `msg:"备注" json:"remark" validate:"omitempty"`           // 备注
	ParentId       uint64 `json:"parentId"`                                       // 新增字段
}
type GetOrganizeDepartmentByIdRespForApiResp struct {
	Data GetOrganizeDepartmentByIdRespForApi `json:"data"`
	Resp
}

type DeleteOrganizeDepartmentByIdReqForApi struct {
	Id uint64 `json:"id" validate:"required"` // 部门ID: 必填，必须大于0
}

type GetOrganizeDepartmentListReqForApi struct {
	Page           int64  `form:"page" validate:"omitempty,gte=1"`                                    // 页码: 必须大于或等于 1
	PageSize       int64  `form:"pageSize" validate:"omitempty,gte=1"`                                // 每页数量: 必须大于或等于 1
	DepartmentName string `msg:"部门名称" form:"departmentName" validate:"omitempty"`                     // 部门名称,可选
	OrganId        uint64 `json:"organId,optional" form:"organId,optional" validate:"omitempty,gt=0"` //组织机构ID
}

type CreatePositionForDepartmentReqForApi struct {
	DepartmentId   uint64 `msg:"部门ID" json:"departmentId" validate:"required"`
	DepartmentName string `msg:"部门名称" json:"departmentName" validate:"required"`
	PositionId     uint64 `msg:"职位ID" json:"positionId" validate:"omitempty"`
	PositionName   string `msg:"职位名称" json:"positionName" validate:"required"`
	OrganId        uint64 `json:"organId,optional" form:"organId,optional" validate:"omitempty,gt=0"` //组织机构ID
}

type DeletePositionForDepartmentReqForApi struct {
	DepartmentId uint64 `msg:"部门ID" json:"departmentId" validate:"required"`
	PositionId   uint64 `msg:"职位ID" json:"positionId" validate:"required"`
}

type GetOrganMenuDistributionListReq struct {
	DepartmentId uint64 `json:"departmentId"`      // 部门id
	PositionId   uint64 `json:"positionId"`        // 职位id
	OrganId      uint64 `json:"organId,optional"`  // 组织机构id
	DomValue     string `json:"domValue,optional"` // 作用域值
}

type OrganMenuDistributionListTree struct {
	Id             uint64                          `json:"id"`             // 菜单id
	ParentId       uint64                          `json:"parentId"`       // 父菜单id
	Sort           int64                           `json:"sort"`           // 排序标记
	Title          string                          `json:"title"`          // 菜单名称
	IsDistribution bool                            `json:"isDistribution"` // 是否分配
	Children       []OrganMenuDistributionListTree `json:"children"`
}
type GetOrganMenuDistributionList struct {
	List []OrganMenuDistributionListTree `json:"list"`
}

type GetOrganMenuDistributionListResp struct {
	Data GetOrganMenuDistributionList `json:"data"`
	Resp
}

type CreateOrganMenuReq struct {
	SourceIds    []uint64 `json:"sourceIds"`         // 资源ids
	DepartmentId uint64   `json:"departmentId"`      // 部门id
	PositionId   uint64   `json:"positionId"`        // 职位id
	OrganId      uint64   `json:"organId,optional"`  // 组织机构id
	DomValue     string   `json:"domValue,optional"` // 作用域值
}

type GetOrganApiDistributionListReq struct {
	DepartmentId uint64 `json:"departmentId"`      // 部门id
	PositionId   uint64 `json:"positionId"`        // 职位id
	OrganId      uint64 `json:"organId,optional"`  // 组织机构id
	DomValue     string `json:"domValue,optional"` // 作用域值
}

type OrganApiDistribution struct {
	Id             uint64 `json:"id"`             // 资源id
	Description    string `json:"description"`    //功能描述
	IsDistribution bool   `json:"isDistribution"` // 是否分配
}
type OrganApiDistributionList struct {
	Id           uint64                 `json:"id"`           // 功能分组id
	ApiGroup     string                 `json:"apiGroup"`     // 功能分组
	ApiGroupName string                 `json:"apiGroupName"` // 功能分组名称
	Sort         int64                  `json:"sort"`         // 排序标记
	ApiList      []OrganApiDistribution `json:"apiList"`      // 功能列表
}
type GetOrganApiDistributionList struct {
	List []OrganApiDistributionList `json:"list"`
}

type GetOrganApiDistributionListResp struct {
	Data GetOrganApiDistributionList `json:"data"`
	Resp
}

type CreateOrganApiReq struct {
	SourceId       uint64 `json:"sourceId"`          // 资源id
	DepartmentId   uint64 `json:"departmentId"`      // 部门id
	PositionId     uint64 `json:"positionId"`        // 职位id
	IsDistribution bool   `json:"isDistribution"`    // 是否分配
	OrganId        uint64 `json:"organId,optional"`  // 组织机构id
	DomValue       string `json:"domValue,optional"` // 作用域值
}
